home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 5 / Gekikoh Dennoh Club Vol. 5 (Japan).7z / Gekikoh Dennoh Club Vol. 5 (Japan) (Track 01).bin / internet / webx / webxp040.lzh / Source / Html2Xpression.c < prev    next >
C/C++ Source or Header  |  1998-09-27  |  40KB  |  1,590 lines

  1. /* HTML âtâ@âCâïé≡ Xpression î`Ä«é╔ò╧è╖ */
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <sys/dos.h>
  7. #include <alloca.h>
  8. #include "WebXpression.h"
  9. #include "Jis2sjis.h"
  10. #include "Tag.h"
  11. #include "Entity.h"
  12. #include "WebCache/WebCache.h"
  13. #include "FuncUrl/FuncUrl.h"
  14.  
  15. /* É▄éΦò╘é╖âhâbâgÉö */
  16. #define WRAP_DOT    (short)512
  17. #define LINE_Y    16
  18.  
  19. #define ALIGN_LEFT        0
  20. #define ALIGN_RIGHT        1
  21. #define ALIGN_CENTER    2
  22.  
  23. #define YOYUU    1024
  24.  
  25.  
  26. extern IMAGE_LIST *InsertImageNode (char *);
  27. extern IMAGE_LIST *SearchImageNode (char *);
  28. extern void McPrint (char *);
  29. extern void McDbPrint (char *);
  30.  
  31. extern int line_table_size;
  32. extern int link_table_size;
  33. extern int link_table_buffer_size;
  34. extern int image_table_size;
  35. extern int anchor_table_size;
  36.  
  37. extern char kmode;
  38.  
  39. unsigned short html_color[8];
  40. unsigned short config_color[8];
  41. //char color_assigned;        /* HTML Æåé┼ÉFé¬ÄwÆΦé│éΩé╜é⌐ */
  42. extern char color_mode;        /* WebXpression.cnf é┼ÄwÆΦé│éΩé╜ÉFé≡Ägéñé⌐ */
  43.  
  44.  
  45. /* æOìsì\æóæ╠ (Before Line Buffer) */
  46. typedef struct _blb {
  47.     struct _blb *before_ptr;/* æOé╠ì\æóæ╠é╓é╠â|âCâôâ^ */
  48.     struct _blb *next_ptr;    /* Äƒé╠ì\æóæ╠é╓é╠â|âCâôâ^ */
  49.     char text[1024];    /* âeâLâXâgû{æ╠ */
  50.     char *ptr;        /* âeâLâXâgé╓é╠â|âCâôâ^ */
  51.     unsigned short start_dot;    /* ì╢Æ[é⌐éτë╜âhâbâgû┌é⌐éτò\ĪèJÄné╖éΘé⌐ */
  52.     //unsigned char font_size;
  53.     unsigned short font_size;
  54.     unsigned short w;
  55. } BLB;
  56.  
  57.  
  58. static BLB *blb_top, *blb_end;
  59. static char tag_href_str[256];
  60.  
  61. static int entity_len[sizeof (entity_str) / sizeof (char *)- 1];
  62.  
  63.  
  64. void InitHtml2Xpression (void)
  65. {
  66.     short h;
  67.     for (h = 0; h < (sizeof (entity_str) / sizeof (char *)- 1); h++)
  68.         entity_len[h] = strlen (entity_str[h]);
  69. }
  70.  
  71.  
  72.  
  73. /* t1 é╠Äwé╖â^âOü^âAâgâèârâàü[âgé≡ attr_no é╔ò╘é╖ */
  74. /* t1 é╠Äwé╖ò╢ÄÜù± = æσò╢ÄÜü^żò╢ÄÜë┬ ü^ str é╠Äwé╖ò╢ÄÜù± = æσò╢ÄÜé╠é▌ */
  75. /* ò╘éΦÆl : Äƒé╠ t1 */
  76. static unsigned char *SearchIItem (unsigned char *t1, char **str, short *attr_no)
  77. {
  78.     char **s = str;
  79.     short no = 0;
  80.  
  81.     do {
  82.         unsigned char *p1 = *s, *p2 = t1;
  83.         for (;;) {
  84.             unsigned char c1, c2;
  85.             if (c1 = *p1++) {
  86.                 c2 = *p2++;
  87.                 if ((c1 != c2) && (c1 != (c2 & 0xdf)))
  88.                     break;
  89.             } else {
  90.                 c2 = *p2++;
  91.                 if ((c2 == 0) || (c2 == ' ') || (c2 == 0x09) || (c2 == 0x0a) || (c2 == 0x0d)) {
  92.                     while (c2 = *p2, ((c2 == ' ') || (c2 == 0x09) || (c2 == 0x0a) || (c2 == 0x0d)))
  93.                         p2++;
  94.                     *attr_no = no;
  95.                     return (p2);
  96.                 }
  97.                 if ((c2 == '=') || (c2 == '>')) {
  98.                     *attr_no = no;
  99.                     return (--p2);    /* t1 é¬ '=' '>' é╠Åπé≡Äwé╖éµéñé╔ */
  100.                 }
  101.                 break;
  102.             }
  103.         }
  104.         no++;
  105.     } while (*(++s) != NULL);
  106.  
  107.     *attr_no = -1;
  108.     return (t1);
  109. }
  110.  
  111.  
  112.  
  113. /* '>' é╠ăé▄é┼âXâLâbâvé╖éΘüBJIS/EUC é┼éαénéj */
  114. static char *SkipLt (char *p1, unsigned char temp_kmode)
  115. {
  116.     char *t1 = p1;
  117.     unsigned char c;
  118.     char aork = 0;        /* ASCII or KANJI */
  119.  
  120.     for (;;) {
  121.         c = *t1++;
  122.         /* JIS Ä₧é╠è┐ÄÜ IN/OUT âtâëâOé╠Åêù¥ */
  123.         if (c == 0x1b) {/* ESC */
  124.             if (temp_kmode == K_JIS) {
  125.                 unsigned char c1 = *(t1 + 1);
  126.                 switch (*t1) {
  127.                 case '(':
  128.                     if ((c1 == 'B') || (c1 == 'J')) {    /* è┐ÄÜ OUT */
  129.                         aork = 0;
  130.                         t1 += 2;
  131.                     }
  132.                     break;
  133.                 case '$':
  134.                     if ((c1 == '@') || (c1 == 'B')) {    /* è┐ÄÜ IN */
  135.                         aork = !0;
  136.                         t1 += 2;
  137.                     }
  138.                     break;
  139.                 default:
  140.                     break;
  141.                 }
  142.                 continue;
  143.             }
  144.         }
  145.         //if ((c >= 0xa0) && (c <= 0xdf))    /* ö╝èpâJâié═û│Äï */
  146.             //continue;
  147.  
  148.         if (((temp_kmode <= K_EUC) && (c < 0x80))    /* AUTO or SJIS or EUC */
  149.             ||((temp_kmode == K_JIS) && (!aork))) {
  150.             /* éPâoâCâgò╢ÄÜé╠ÅΩìç */
  151.             if (c == '>')
  152.                 break;
  153.         } else {
  154.             /* è┐ÄÜé╠ÅΩìç */
  155.             t1++;
  156.         }
  157.     }
  158.     return (t1);
  159. }
  160.  
  161.  
  162.  
  163. /* âAâgâèârâàü[âgé≡âXâLâbâvé╖éΘ */
  164. static char *SkipAttr (char *p1, unsigned char temp_kmode)
  165. {
  166.     char *t1 = p1;
  167.     unsigned char c;
  168.     char aork = 0;        /* ASCII or KANJI */
  169.     char quot_flag = 0;
  170.  
  171.     /* û{æ╠é≡âXâLâbâv */
  172.     //while (c = *t1, (c != ' ') && (c != 0x09) && (c != 0x0d) && (c != 0x0a) && (c != '='))
  173.         //t1++;
  174.     //c = *t1;
  175.     /* Ælé¬û│éóÅΩìç */
  176.     //if (c != '=')
  177.         //return (t1);
  178.  
  179.     t1++;            /* '=' é╠é╘é± */
  180.     c = *t1;
  181.     if (c == '"') {
  182.         quot_flag = 1;
  183.         t1++;
  184.     }
  185.     if (c == '\'') {
  186.         quot_flag = 2;
  187.         t1++;
  188.     }
  189.     for (;;) {
  190.         c = *t1++;
  191.         /* JIS Ä₧é╠è┐ÄÜ IN/OUT âtâëâOé╠Åêù¥ */
  192.         if (c == 0x1b) {/* ESC */
  193.             if (temp_kmode == K_JIS) {
  194.                 unsigned char c1 = *(t1 + 1);
  195.                 switch (*t1) {
  196.                 case '(':
  197.                     if ((c1 == 'B') || (c1 == 'J')) {    /* è┐ÄÜ OUT */
  198.                         aork = 0;
  199.                         t1 += 2;
  200.                     }
  201.                     break;
  202.                 case '$':
  203.                     if ((c1 == '@') || (c1 == 'B')) {    /* è┐ÄÜ IN */
  204.                         aork = !0;
  205.                         t1 += 2;
  206.                     }
  207.                     break;
  208.                 default:
  209.                     break;
  210.                 }
  211.                 continue;
  212.             }
  213.         }
  214.         //if ((c >= 0xa0) && (c <= 0xdf))    /* ö╝èpâJâié═û│Äï */
  215.             //continue;
  216.  
  217.         if (((temp_kmode <= K_EUC) && (c < 0x80))    /* AUTO or SJIS or EUC */
  218.             ||((temp_kmode == K_JIS) && (!aork))) {
  219.             /* éPâoâCâgò╢ÄÜé╠ÅΩìç */
  220.             switch (quot_flag) {
  221.             case 0:
  222.                 if ((c == ' ') || (c == 0x09) || (c == 0x0d) || (c == 0x0a))
  223.                     return (t1);
  224.                 if (c == '>')
  225.                     return (--t1);
  226.                 break;
  227.             case 1:
  228.                 if (c == '"')
  229.                     return (t1);
  230.                 break;
  231.             case 2:
  232.                 if (c == '\'')
  233.                     return (t1);
  234.                 break;
  235.             }
  236.         } else {
  237.             /* è┐ÄÜé╠ÅΩìç */
  238.             t1++;
  239.         }
  240.     }
  241.     return (t1);        /* é▒é▒é╔é═ùêé╚éóânâY */
  242. }
  243.  
  244.  
  245.  
  246. /* ò╢ÄÜù±é≡âRâsü[é╖éΘ "" é┼ê═é▄éΩé─éóé─éα JIS/EUC é┼éαénéj */
  247. static char *CopyItem (char *p2, char *p1, unsigned char temp_kmode)
  248. {
  249.     char *t1 = p1, *t2 = p2;
  250.     unsigned char c;
  251.     char aork = 0;        /* ASCII or KANJI */
  252.     char quot_flag = 0;
  253.  
  254.  
  255.     while (c = *t1, (c == ' ') || (c == 0x09) || (c == 0x0d) || (c == 0x0a))
  256.         t1++;
  257.  
  258.     c = *t1;
  259.     if (c == '"') {
  260.         quot_flag = 1;
  261.         t1++;
  262.     }
  263.     if (c == '\'') {
  264.         quot_flag = 2;
  265.         t1++;
  266.     }
  267.     for (;;) {
  268.         c = *t1++;
  269.         /* JIS Ä₧é╠è┐ÄÜ IN/OUT âtâëâOé╠Åêù¥ */
  270.         if (c == 0x1b) {/* ESC */
  271.             if (temp_kmode == K_JIS) {
  272.                 unsigned char c1 = *(t1 + 1);
  273.                 switch (*t1) {
  274.                 case '(':
  275.                     if ((c1 == 'B') || (c1 == 'J')) {    /* è┐ÄÜ OUT */
  276.                         aork = 0;
  277.                         t1 += 2;
  278.                     }
  279.                     break;
  280.                 case '$':
  281.                     if ((c1 == '@') || (c1 == 'B')) {    /* è┐ÄÜ IN */
  282.                         aork = !0;
  283.                         t1 += 2;
  284.                     }
  285.                     break;
  286.                 default:
  287.                     break;
  288.                 }
  289.                 continue;
  290.             }
  291.         }
  292.         if (c < ' ') {
  293.             //*t2++ = c;
  294.             continue;
  295.         }
  296.         //if ((c >= 0xa0) && (c <= 0xdf))    /* ö╝èpâJâié═û│Äï */
  297.             //continue;
  298.  
  299.         if (((temp_kmode <= K_EUC) && (c < 0x80))    /* AUTO or SJIS or EUC */
  300.             ||((temp_kmode == K_JIS) && (!aork))) {
  301.             /* éPâoâCâgò╢ÄÜé╠ÅΩìç */
  302.             switch (quot_flag) {
  303.             case 0:
  304.                 if ((c == ' ') || (c == 0x09) || (c == 0x0d) || (c == 0x0a)) {
  305.                     *t2 = '\0';
  306.                     return (t1);
  307.                 }
  308.                 if (c == '>') {
  309.                     *t2 = '\0';
  310.                     return (--t1);
  311.                 }
  312.                 break;
  313.             case 1:
  314.                 if (c == '"') {
  315.                     *t2 = '\0';
  316.                     return (t1);
  317.                 }
  318.                 break;
  319.             case 2:
  320.                 if (c == '\'') {
  321.                     *t2 = '\0';
  322.                     return (t1);
  323.                 }
  324.                 break;
  325.             }
  326.             *t2++ = c;
  327.             continue;
  328.         } else {
  329.             /* è┐ÄÜé╠ÅΩìç */
  330.             switch (temp_kmode) {
  331.             case K_AUTO:
  332.             case K_SJIS:
  333.                 *t2++ = c;
  334.                 *t2++ = *t1++;
  335.                 break;
  336.             case K_EUC:
  337.                 Jis2sjis (((c & 0x7f)), (*t1++ & 0x7f), t2);
  338.                 break;
  339.             case K_JIS:
  340.                 Jis2sjis (c, *t1++, t2);
  341.                 break;
  342.             }
  343.             continue;
  344.         }
  345.     }
  346.     return (t1);        /* é▒é▒é╔é═ùêé╚éóânâY */
  347. }
  348.  
  349.  
  350.  
  351. /* "#ffffff" é╠éµéñé╚ÉFÄwÆΦé≡ 16bit ÉFé╔ */
  352. static unsigned short Str2Color (char *p)
  353. {
  354.     unsigned short col = 0;
  355.     short h;
  356.  
  357.     p++;
  358.     for (h = 0; h < 6; h++) {
  359.         unsigned char c = *p++;
  360.         unsigned char s[6] =
  361.         {6 + 1, 6, 11 + 1, 11, 1 + 1, 1};
  362.         unsigned char a[6] =
  363.         {0xf, 0x8, 0xf, 0x8, 0xf, 0x8};
  364.  
  365.         if ((c >= '0') && (c <= '9'))
  366.             col |= ((unsigned short) ((c - '0') & a[h])) << s[h];
  367.         else
  368.             col |= ((unsigned short) (((c & 0xdf) - 'A' + 10) & a[h])) << s[h];
  369.     }
  370.     col |= 1;        /* 0x0000 é╛é╞é▄é╕éóé╠é┼ */
  371.  
  372.     return (col);
  373. }
  374.  
  375.  
  376.  
  377. /* ûûö÷é╔âmü[âh(BLB)é≡éPé┬Æ╟ë┴é╖éΘ */
  378. static BLB *InsertNodeBLB (signed short nest,
  379.         unsigned char c, unsigned char c1, unsigned short font_size, unsigned short w,
  380.                short image_table_max, int hh, int y_offset)
  381. {
  382.     BLB *t_ptr = blb_top;
  383.     signed short h = nest;
  384.  
  385.     /* âèâXâgé≡îƒì⌡é╡é─éáéΩé╬é╗é╠â|âCâôâ^üAé╚é»éΩé╬ì∞ɼé╡é─é╗é╠â|âCâôâ^é≡ò╘é╖ */
  386.     while (--h != 0) {
  387.         t_ptr = t_ptr->next_ptr;
  388.     };
  389.     if (t_ptr == NULL) {
  390.         /* é╚é⌐é┴é╜é╠é┼ì∞ɼ */
  391.         if ((t_ptr = malloc (sizeof (BLB))) == NULL) {
  392.             McPrint ("InsertNodeBLB() : âüâéâèé¬æ½éΦé▄é╣é±\n");
  393.             return (NULL);
  394.         } else {
  395.             if (blb_top == NULL) {
  396.                 /* âmü[âhéOî┬é╠Åèé╔Æ╟ë┴ */
  397.                 blb_top = t_ptr;
  398.                 blb_end = t_ptr;
  399.                 t_ptr->before_ptr = NULL;
  400.                 t_ptr->next_ptr = NULL;
  401.             } else {
  402.                 /* ûûö÷é╔âmü[âhé≡Æ╟ë┴ */
  403.                 (blb_end)->next_ptr = t_ptr;
  404.                 t_ptr->before_ptr = blb_end;
  405.                 t_ptr->next_ptr = NULL;
  406.                 blb_end = t_ptr;
  407.             }
  408.             *(t_ptr->text) = '\0';
  409.             t_ptr->ptr = &(t_ptr->text[0]);
  410.             t_ptr->start_dot = 0;
  411.             t_ptr->font_size = 0;
  412.             t_ptr->w = 0;
  413.         }
  414.     }
  415.     if ((c) || (c1)) {
  416.         /* æσé½éóò╢ÄÜé╠æOìsÅêù¥ */
  417.         if (!c1) {
  418.             /* éPâoâCâgò╢ÄÜ */
  419.             if ((t_ptr->font_size == font_size) && (t_ptr->w + t_ptr->font_size == w)) {
  420.                 /* æOë±é╞ô»é╢âtâHâôâgâTâCâYé╠ÿAæ▒é╖éΘò╢ÄÜé╚éτ */
  421.                 *t_ptr->ptr++ = c;
  422.                 t_ptr->w = w;
  423.             } else {
  424.                 t_ptr->font_size = font_size;
  425.                 t_ptr->w = w;
  426.                 t_ptr->ptr += sprintf (t_ptr->ptr, "`D%dS%d`", w, font_size);
  427.                 *t_ptr->ptr++ = c;
  428.             }
  429.         } else {
  430.             /* éQâoâCâgò╢ÄÜ */
  431.             if ((t_ptr->font_size == font_size) && (t_ptr->w + t_ptr->font_size * 2 == w)) {
  432.                 /* æOë±é╞ô»é╢âtâHâôâgâTâCâYé╠ÿAæ▒é╖éΘò╢ÄÜé╚éτ */
  433.                 *t_ptr->ptr++ = c;
  434.                 *t_ptr->ptr++ = c1;
  435.                 t_ptr->w = w;
  436.             } else {
  437.                 t_ptr->font_size = font_size;
  438.                 t_ptr->w = w;
  439.                 t_ptr->ptr += sprintf (t_ptr->ptr, "`D%dS%d`", w, font_size);
  440.                 *t_ptr->ptr++ = c;
  441.                 *t_ptr->ptr++ = c1;
  442.             }
  443.         }
  444.     } else {
  445.         /* æσé½éóâCâüü[âWé╠æOìsÅêù¥ */
  446.         t_ptr->w = w;
  447.         if (*tag_href_str) {    /* âèâôâNé¬éáéΘé⌐üH */
  448.             t_ptr->ptr += sprintf (t_ptr->ptr, "`D%d`%s`G%d,%d,%x``lu`",
  449.                            w, tag_href_str, image_table_max, hh, y_offset);
  450.         } else {
  451.             t_ptr->ptr += sprintf (t_ptr->ptr, "`D%dG%d,%d,%xU`",
  452.                            w, image_table_max, hh, y_offset);
  453.         }
  454.     }
  455.     *t_ptr->ptr = '\0';
  456.  
  457.     return (t_ptr);
  458. }
  459.  
  460.  
  461.  
  462. /* ûûö÷é╠âmü[âh(BLB)é≡ìφÅ£é╖éΘüiÄ└ì█é╔é═ìφÅ£é╡é╚éóüj */
  463. static BLB *DeleteNodeBLB (void)
  464. {
  465.     BLB *t_ptr = blb_end;
  466.  
  467.     if (blb_top == NULL)
  468.         return (NULL);
  469.  
  470.     if (blb_end->before_ptr == NULL) {
  471.         /* éPé┬é╡é⌐é╚éóâmü[âhé≡ìφÅ£é╖éΘ */
  472.         blb_top = NULL;
  473.         blb_end = NULL;
  474.     } else {
  475.         (blb_end->before_ptr)->next_ptr = NULL;
  476.         blb_end = blb_end->before_ptr;
  477.     }
  478.     return (t_ptr);
  479. }
  480.  
  481.  
  482.  
  483. XPTEXT *Html2Xpression (HTTPFILE * httpfile, XPTEXT * old_xptext)
  484. {
  485.     XPTEXT *xptext;        /* ò╘éΦÆl */
  486.     LINE_PTR *l;        /* î╗ì▌Åêù¥é╡é─éóéΘìsâeü[âuâï */
  487.     unsigned short w;    /* âhâbâgÉö */
  488.     //register unsigned short w asm ("d7");    /* âhâbâgÉö */
  489.     //unsigned char *t1, *t2;    /* î╗ì▌Åêù¥é╡é─éóéΘò╢ÄÜ */
  490.     register unsigned char *t1 asm ("a4");    /* î╗ì▌Åêù¥é╡é─éóéΘò╢ÄÜüiô]æùî│üj */
  491.     register unsigned char *t2 asm ("a5");    /* üV           üiô]æùɵüj */
  492.     unsigned char *t1e, *t2e;    /* t1,t2 é╠ûûö÷ */
  493.     unsigned char *t1_old;    /* üuÅêù¥é╡é╜ò╢ÄÜé≡ô╟é▄é╚é⌐é┴é╜Äûé╔é╖éΘüvùp */
  494.     unsigned char *t2t;    /* é╗é╠ìsé╠ɵô¬é╠ t2 */
  495.     unsigned int t2_size = 0;    /* t2 é╠âTâCâY */
  496.     //unsigned char c;    /* Åêù¥é╖éΘò╢ÄÜ */
  497.     register unsigned char c asm ("d7");    /* Åêù¥é╖éΘò╢ÄÜ */
  498.     unsigned char *tag_head = NULL;    /* <head>é╠ăé╠âAâhâîâX */
  499.     unsigned char *tag_title = NULL;    /* <title>é╠ăé╠âAâhâîâX */
  500.     unsigned char tag_href = 0;
  501.     unsigned char align = ALIGN_LEFT;    /* ìsæ╡éªâéü[âh */
  502.     unsigned char tag_center = 0;
  503.     unsigned char tag_p_align = 0;
  504.     unsigned char tag_pre = 0;
  505.     unsigned char tag_ol = 0;
  506.     unsigned char tag_ul = 0;
  507.     unsigned short tag_list_no = 0;
  508. #if    0
  509.     unsigned char tag_bold = 0;
  510.     unsigned char tag_italic = 0;
  511.     unsigned char tag_underline = 0;
  512.     unsigned char font_type = 0;
  513. #endif
  514.     //unsigned char font_size = 6;    /* ö╝èpò╢ÄÜé╠æσé½é│ */
  515.     unsigned short font_size = 6;    /* ö╝èpò╢ÄÜé╠æσé½é│ */
  516.     //register unsigned char font_size asm ("d6") = 6;    /* ö╝èpò╢ÄÜé╠æσé½é│ */
  517.     unsigned char font_size_stack[256];
  518.     unsigned char font_size_stackptr = 0;
  519.     unsigned char space_flag = 0;    /* Æ╝æOé¬ö╝èpâXâyü[âXé╛é┴é╜é⌐ */
  520.     unsigned short ffifo_ptr = 0;
  521.     char ffifo[256];
  522.     char *link_table_buffer_ptr = NULL;
  523.     char scheme[256], hostname[256], path[256], fname[256], query[256], anchor[256];
  524.     int port;
  525.     HTTPFILE *httpfile2;    /* âeâôâ|âëâèùp */
  526.     unsigned char pass;    /* =0:éPâpâXû┌ =!0:éQâpâXû┌ */
  527.     unsigned char temp_kmode = kmode;    /* ò╢ÄÜâRü[âh */
  528.     char aork = 0;        /* JIS ùp ASCII(=0) or KANJI(=!0) */
  529.     char reset_align = 0;
  530.     unsigned short org_line = 0;    /* î│é╠ HTML é╠ë╜ìsû┌é╛é┴é╜é⌐ */
  531.  
  532.     xptext = _dos_malloc (sizeof (XPTEXT));
  533.     xptext->text = NULL;
  534.     xptext->line_ptr = NULL;
  535.     xptext->anchor_table = NULL;
  536.  
  537.     *(xptext->title) = '\0';
  538.     strcpy (xptext->title, "â^âCâgâïûóÉ▌ÆΦ");
  539.     httpfile2 = alloca (sizeof (HTTPFILE));
  540.     if (old_xptext)        /* éPâpâXû┌é⌐üH */
  541.         pass = !0;
  542.     else
  543.         pass = 0;
  544.  
  545.     if (!pass) {
  546.         short h;
  547.         for (h = 0; h < 8; h++)
  548.             html_color[h] = config_color[h];
  549.     }
  550. #define XPTEXT_BUFFER_YOYUU    32768
  551.     /* é▒éΩê╩éáéΩé╬æ½éΦéΘé⌐é╚üH */
  552.     t2_size = httpfile->content_length * 2 + XPTEXT_BUFFER_YOYUU;
  553.  
  554.     if ((xptext->text = _dos_malloc (t2_size)) == NULL) {
  555.         McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiâeâLâXâgâoâbâtâ@ùpé╠âüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  556.         return (NULL);
  557.     }
  558.     /* ùvé╖éΘé╔ *t1üié╫é╜ô╟é▌é╡é╜ .HTMüjé⌐éτ *t2 é╔É«î`é╡é╚é¬éτâRâsü[é╡é─éóé¡éφé»é╛ */
  559.     t1 = httpfile->content;    /* html âtâ@âCâïû{æ╠é╓é╠â|âCâôâ^ */
  560.     t1e = t1 + httpfile->content_length;    /* t1 é¬ t1e é╔ÆBé╡é╜éτÅIù╣ */
  561.     t2 = xptext->text;    /* xptext âoâbâtâ@é╓é╠â|âCâôâ^ */
  562.     t2e = t2 + t2_size - YOYUU;
  563.     /* t2 é¬ t2e é╔ÆBé╡é╜éτÅIù╣üiâoâbâtâ@òsæ½üj */
  564.  
  565.     /* é╞éΦéáéªé╕î┼ÆΦâTâCâYé┼èmò█ */
  566.     if ((xptext->line_ptr = _dos_malloc (sizeof (LINE_PTR) * line_table_size)) == NULL) {
  567.         McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiìsô¬âèâXâgùpâüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  568.         return (NULL);
  569.     }
  570.     l = xptext->line_ptr;
  571.     xptext->line = 0;
  572.     xptext->current_line = 0;
  573.  
  574.     /* é╞éΦéáéªé╕î┼ÆΦâTâCâYé┼èmò█ */
  575.     if ((xptext->anchor_table = _dos_malloc (sizeof (ANCHOR_TABLE) * anchor_table_size)) == NULL) {
  576.         McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiâAâôâJü[âeü[âuâïùpé╠âüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  577.         return (NULL);
  578.     }
  579.     xptext->anchor_table_max = 0;
  580.  
  581.     if (!pass) {
  582.         /* Åëë±é╠ë≡É═é╚éτ */
  583.         xptext->link_table = NULL;
  584.         xptext->link_table_buffer = NULL;
  585.         xptext->image_table = NULL;
  586.  
  587.         /* é╞éΦéáéªé╕î┼ÆΦâTâCâYé┼èmò█ */
  588.         if ((xptext->link_table = _dos_malloc (sizeof (LINK_TABLE) * link_table_size)) == NULL) {
  589.             McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiâèâôâNâeü[âuâïùpé╠âüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  590.             return (NULL);
  591.         }
  592.         /* é╞éΦéáéªé╕î┼ÆΦâTâCâYé┼èmò█ */
  593.         if ((xptext->link_table_buffer = _dos_malloc (sizeof (unsigned char) * link_table_buffer_size)) == NULL) {
  594.             McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiâèâôâNâeü[âuâïâoâbâtâ@ùpé╠âüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  595.             return (NULL);
  596.         }
  597.         link_table_buffer_ptr = xptext->link_table_buffer;
  598.         UrlSplit (httpfile->url, scheme, hostname, path, fname, query, anchor, &port);
  599.  
  600.         /* é╞éΦéáéªé╕î┼ÆΦâTâCâYé┼èmò█ */
  601.         if ((xptext->image_table = _dos_malloc (sizeof (IMAGE_TABLE) * image_table_size)) == NULL) {
  602.             McPrint ("üª âüâéâèé¬æ½éΦé▄é╣é±üiâCâüü[âWâeü[âuâïùpé╠âüâéâèé¬èmò█é┼é½é▄é╣é±üj\n");
  603.             return (NULL);
  604.         } {        /* debug âoâOé┴é─éα NULL â|âCâôâ^é┼Ä~é▄éΘéµéñé╔ */
  605.             short h;
  606.             for (h = 0; h < image_table_size; h++)
  607.                 (xptext->image_table)[h].image_list = NULL;
  608.         }
  609.     } else {
  610.         /* éQë±û┌ê╚ì~é╠ë≡É═é╚éτ */
  611.         xptext->image_table = old_xptext->image_table;
  612.         temp_kmode = old_xptext->kmode;
  613.     }
  614.     xptext->link_table_max = 0;
  615.     xptext->image_table_max = 0;
  616.  
  617.     /* ìsâïü[âv */
  618.     do {
  619.         blb_top = NULL;
  620.         blb_end = NULL;
  621.         w = 0;
  622.         t2t = t2;
  623.  
  624.         space_flag = 0;
  625.  
  626.         if (ffifo_ptr) {
  627.             switch (ffifo[--ffifo_ptr]) {
  628.             case 'h':
  629.                 strcpy (t2, "`S08`ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬ä¬");
  630.                 w = 64 * 8;
  631.                 t2 += 69;
  632.                 break;
  633.             case 'l':
  634.                 if (tag_ol) {    /* ö╘ìåòté½âèâXâg */
  635.                     t2 += sprintf (t2, "%hd:", tag_list_no);
  636.                     w += font_size * 4;
  637.                     if (++tag_list_no > 999)
  638.                         tag_list_no = 1;
  639.                 } else {
  640.                     if (tag_ul) {    /* ö╘ìåû│é╡âèâXâg */
  641.                         t2 += sprintf (t2, "üE");
  642.                         w += font_size * 2;
  643.                     }
  644.                 }
  645.                 break;
  646.             case 'd':    /* â^âO <dd> */
  647.                 *t2++ = 0x09;
  648.                 w = (w + 6 * 8) / (short) (6 * 8) * (short) (6 * 8);
  649.                 break;
  650.             default:
  651.                 break;
  652.             }
  653.             ffifo_ptr = 0;    /* éóéτé╚éóânâYé╚é±é╛é¬üEüEüE */
  654.         }
  655.         if (font_size != 6)    /* æOìsé⌐éτæσé½éóò╢ÄÜé¬æ▒éóé─éóéΩé╬ */
  656.             t2 += sprintf (t2, "`S%d`", font_size);
  657.         if (tag_href)    /* æOìsé⌐éτâ^âOé¬æ▒éóé─éóéΩé╬ */
  658.             t2 += sprintf (t2, "%s", tag_href_str);
  659.         *tag_href_str = '\0';
  660.  
  661.         /* îàâïü[âv */
  662.         do {
  663.             t1_old = t1;
  664.             c = *t1++;
  665.  
  666.             if ((c == '<')    /* â^âOö¡î⌐üI */
  667.                 &&((temp_kmode <= K_EUC)    /* AUTO or SJIS or EUC */
  668.                    ||((temp_kmode == K_JIS) && (!aork)))) {
  669.                 short tag_no;
  670.                 char nl_flag = 0;    /* ëⁿìsé╖éΘé╚éτ = !0 */
  671.                 char not_read_flag = 0;    /* ò╢ÄÜé≡ô╟é▄é╚é⌐é┴é╜Äûé╔é╖éΘé╚éτ= !0 */
  672.  
  673.                 /* '<' é╠îπé╔âXâyü[âXé¬éáéΩé╬ô╟é▌ö≥é╬é╖ */
  674.                 while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  675.                     t1++;
  676.  
  677.                 /* t1 é╠Äwé╖â^âOé≡ tag_no é╔ò╘é╖ */
  678.                 t1 = SearchIItem (t1, tag_str, &tag_no);
  679.  
  680.                 /*
  681.                    é▒é▒é╔ùêé╜Ä₧ô_é┼ t1 é═â^âOé╠ăüiâXâyü[âXé¬éáéΩé╬ô╟é▌ö≥é╬é╖üjé≡Äwé╡
  682.                    é─éóéΘüB"<A HREF=" é╛é┴é╜éτ 'H'üA"<BR>" é╛é┴é╜éτ">"üB
  683.                 */
  684.  
  685. #if 0
  686.                 if (tag_no >= 0) {
  687.                     char temp_str[256];
  688.                     sprintf (temp_str, "TAG : %s\n", tag_str[tag_no]);
  689.                     McDbPrint (temp_str);
  690.                 }
  691. #endif
  692.                 /* â^âOé╔éµé┴é─ò¬è≥ */
  693.                 switch (tag_no) {
  694.                 case TAG_BR:
  695.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  696.                     break;
  697.  
  698.                 case TAG_A:
  699.                     while (*t1 != '>') {
  700.                         short attr_no;
  701.                         t1 = SearchIItem (t1, attr_a_str, &attr_no);
  702.  
  703.                         switch (attr_no) {
  704.                         case ATTR_A_HREF:
  705.                             while (*t1++ != '=');
  706.  
  707.                             if (!pass) {
  708.                                 /* Åëë±é╠ë≡É═é╚éτ */
  709.                                 char temp_str[256], temp_fname[256];
  710.                                 char *t = temp_str;
  711.  
  712.                                 /* temp_str é╔âRâsü[ */
  713.                                 t1 = CopyItem (t, t1, temp_kmode);
  714.                                 ((xptext->link_table)[xptext->link_table_max]).url = link_table_buffer_ptr;
  715.                                 /* "#foo"üiâtâ@âCâïû╝é╚é╡üjé⌐üH */
  716.                                 if (*t == '#')
  717.                                     UrlCat (link_table_buffer_ptr, scheme, hostname, path, fname, query, temp_str, port);
  718.                                 else
  719.                                     UrlCat (link_table_buffer_ptr, scheme, hostname, path, temp_str, query, anchor, port);
  720.                                 strcpy (httpfile2->url, link_table_buffer_ptr);
  721.                                 if (WCExist (httpfile2, temp_fname) > WC_NON)
  722.                                     (xptext->link_table)[xptext->link_table_max].in_cache = !0;
  723.                                 else
  724.                                     (xptext->link_table)[xptext->link_table_max].in_cache = 0;
  725.                                 while (*link_table_buffer_ptr++);
  726.                             } else {
  727.                                 t1 = SkipAttr (t1, temp_kmode);
  728.                             }
  729.                             sprintf (tag_href_str, "`L%dU`", xptext->link_table_max);
  730.                             t2 += sprintf (t2, "%s", tag_href_str);
  731.                             tag_href = !0;
  732.                             xptext->link_table_max++;
  733.                             break;
  734.  
  735.                         case ATTR_A_NAME:
  736.                             while (*t1++ != '=');
  737.                             {
  738.                                 char temp_str[256];
  739.                                 char *t = temp_str;
  740.  
  741.                                 /* temp_str é╔âRâsü[ */
  742.                                 t1 = CopyItem (t, t1, temp_kmode);
  743.                                 temp_str[SIZE_OF_ANCHOR] = '\0';
  744.                                 strcpy (((xptext->anchor_table)[xptext->anchor_table_max]).anchor, temp_str);
  745.                                 ((xptext->anchor_table)[xptext->anchor_table_max]).line = xptext->line;
  746.                             }
  747.                             xptext->anchor_table_max++;
  748.                             break;
  749.  
  750.                         default:
  751.                             t1 = SkipAttr (t1, temp_kmode);
  752.                             break;
  753.                         }
  754.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  755.                             t1++;
  756.                     }
  757.                     break;
  758.  
  759.                 case _TAG_A:
  760.                     strcpy (t2, "`lu`");
  761.                     t2 += 4;
  762.                     tag_href = 0;
  763.                     *tag_href_str = '\0';
  764.                     break;
  765.  
  766.                 case TAG_IMG:
  767.                     while (*t1 != '>') {
  768.                         short attr_no;
  769.                         char img_src_flag = 0;
  770.                         t1 = SearchIItem (t1, attr_img_str, &attr_no);
  771.  
  772.                         switch (attr_no) {
  773.                         case ATTR_IMG_SRC:
  774.                             while (*t1++ != '=');
  775.                             img_src_flag = !0;
  776.  
  777.                             if (!pass) {
  778.                                 /* Åëë±é╠ë≡É═é╚éτ */
  779.                                 char temp_str[256], temp_url[256];
  780.                                 char *t = temp_str;
  781.                                 IMAGE_LIST *t_ptr;
  782.  
  783.                                 /* temp_str é╔âRâsü[ */
  784.                                 t1 = CopyItem (t, t1, temp_kmode);
  785.                                 UrlCat (temp_url, scheme, hostname, path, temp_str, "", "", port);
  786.  
  787.                                 /*
  788.                                    âCâüü[âWâèâXâgé╔æ╢ì▌é╖éΘé⌐
  789.                                 
  790.                                 */
  791.                                 if ((t_ptr = SearchImageNode (temp_url)) == NULL) {
  792.                                     /* æ╢ì▌é╡é╚éóÅΩìç */
  793.                                     t_ptr = InsertImageNode (temp_url);
  794.                                 }
  795.                                 (xptext->image_table)[xptext->image_table_max].image_list = t_ptr;
  796.                                 (xptext->image_table)[xptext->image_table_max].in_cache = 0;
  797.                             } else {
  798.                                 t1 = SkipAttr (t1, temp_kmode);
  799.                             }
  800.                             break;
  801.                         case ATTR_IMG_WIDTH:
  802.                             /*
  803.                                Åëë±é╠ë≡É═é┼é⌐é┬ IMG SRC é≡Åêù¥é╕é▌é╚éτ
  804.                             */
  805.                             if ((!pass) && (img_src_flag)) {
  806.                                 IMAGE_LIST *t_ptr;
  807.                                 t_ptr = (xptext->image_table)[xptext->image_table_max].image_list;
  808.                                 if (!(t_ptr->x)) {
  809.                                     char temp_str[256];
  810.                                     char *t = temp_str;
  811.                                     while (*t1++ != '=');
  812.                                     /*
  813.                                        temp_str é╔âRâsü[
  814.                                     
  815.                                     */
  816.                                     t1 = CopyItem (t, t1, temp_kmode);
  817.                                     if (!(t_ptr->x = atoi (t) / 2))
  818.                                         t_ptr->x = 1;
  819.                                 } else {
  820.                                     t1 = SkipAttr (t1, temp_kmode);
  821.                                 }
  822.                             } else {
  823.                                 t1 = SkipAttr (t1, temp_kmode);
  824.                             }
  825.                             break;
  826.                         case ATTR_IMG_HEIGHT:
  827.                             /*
  828.                                Åëë±é╠ë≡É═é┼é⌐é┬ IMG SRC é≡Åêù¥é╕é▌é╚éτ
  829.                             */
  830.                             if ((!pass) && (img_src_flag)) {
  831.                                 IMAGE_LIST *t_ptr;
  832.                                 t_ptr = (xptext->image_table)[xptext->image_table_max].image_list;
  833.                                 if (!(t_ptr->y)) {
  834.                                     char temp_str[256];
  835.                                     char *t = temp_str;
  836.                                     while (*t1++ != '=');
  837.                                     /*
  838.                                        temp_str é╔âRâsü[
  839.                                     
  840.                                     */
  841.                                     t1 = CopyItem (t, t1, temp_kmode);
  842.                                     if (!(t_ptr->y = atoi (t) / 2))
  843.                                         t_ptr->y = 1;
  844.                                 } else {
  845.                                     t1 = SkipAttr (t1, temp_kmode);
  846.                                 }
  847.                             } else {
  848.                                 t1 = SkipAttr (t1, temp_kmode);
  849.                             }
  850.                             break;
  851.                         case ATTR_IMG_ALT:
  852.                             t1 = SkipAttr (t1, temp_kmode);
  853.                             break;
  854.                         default:
  855.                             t1 = SkipAttr (t1, temp_kmode);
  856.                         }
  857.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  858.                             t1++;
  859.                     }
  860.                     /* âfü[â^é═âüâéâèÅπé╔éáéΘé⌐ */
  861.                     {
  862.                         IMAGE_LIST *t_ptr;
  863.                         t_ptr = (xptext->image_table)[xptext->image_table_max].image_list;
  864.                         if ((t_ptr->data == NULL) && (!(t_ptr->x)) && (!(t_ptr->y))) {
  865.                             if ((short) (w + font_size * 4) > WRAP_DOT) {
  866.                                 /* ô╟é▄é╚é⌐é┴é╜é▒é╞é╔é╖éΘ */
  867.                                 not_read_flag = !0;
  868.                                 t_ptr->count--;
  869.                                 nl_flag = !0;
  870.                                 break;
  871.                             } else {
  872.                                 strcpy (t2, "[èG]");
  873.                                 t2 += 4;
  874.                                 w += font_size * 4;
  875.                             }
  876.                         } else {
  877.                             short y;
  878.                             int h = 1, hh, y_offset;
  879.  
  880.                             (xptext->image_table)[xptext->image_table_max].disp_x = t_ptr->x;
  881.                             /* ëµæ£é¬ëEÆ[é⌐éτé═é▌Åoé─é╡é▄éñé⌐üH */
  882.                             if ((w + t_ptr->x) > WRAP_DOT) {
  883.                                 if (w > 0) {
  884.                                     /* æùéΦï╓æÑé╡é─ë≡îê */
  885.                                     not_read_flag = !0;
  886.                                     t_ptr->count--;
  887.                                     nl_flag = !0;    /* Äƒé╠ìsé╓ */
  888.                                     break;
  889.                                 } else {
  890.                                     /*
  891.                                        é╟éñé╡é─éαëµû╩é╔Ä√é▄éτé╚éó
  892.                                     
  893.                                     */
  894.                                     if (t_ptr->x > WRAP_DOT)
  895.                                         (xptext->image_table)[xptext->image_table_max].disp_x = WRAP_DOT;
  896.                                 }
  897.                             }
  898.                             y = t_ptr->y;
  899.                             if (t_ptr->y < 16) {
  900.                                 hh = 16 - y;
  901.                                 y_offset = 0;
  902.                             } else {
  903.                                 hh = 0;
  904.                                 y_offset = t_ptr->x * 2 * (t_ptr->y - 16);
  905.                             }
  906.                             t2 += sprintf (t2, "`G%d,%d,%x`", xptext->image_table_max, hh, y_offset);
  907.                             while ((y -= LINE_Y) > 0) {
  908.                                 y_offset -= t_ptr->x * 2 * 16;
  909.                                 if (y_offset < 0) {
  910.                                     y_offset = 0;
  911.                                     hh = 16 - y;
  912.                                 } else {
  913.                                     hh = 0;
  914.                                 }
  915.                                 InsertNodeBLB (h++, 0, 0, 0,
  916.                                            w, xptext->image_table_max, hh, y_offset);
  917.                             }
  918.                             w += (xptext->image_table)[xptext->image_table_max].disp_x;
  919.                         }
  920.                     }
  921.                     xptext->image_table_max++;
  922.                     break;
  923.  
  924.                 case TAG_FRAMESET:
  925.                     t2 += sprintf (t2, "üª é▒é╠âyü[âWé═âtâîü[âÇé¬ÄgéφéΩé─éóé▄é╖");
  926.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  927.                     break;
  928.  
  929.                 case TAG_FRAME:
  930.                     while (*t1 != '>') {
  931.                         short attr_no;
  932.                         t1 = SearchIItem (t1, attr_frame_str, &attr_no);
  933.  
  934.                         switch (attr_no) {
  935.                         case ATTR_FRAME_SRC:
  936.                             while (*t1++ != '=');
  937.  
  938.                             if (!pass) {
  939.                                 /* Åëë±é╠ë≡É═é╚éτ */
  940.                                 char temp_str[256], temp_fname[256];
  941.                                 char *t = temp_str;
  942.  
  943.                                 /* temp_str é╔âRâsü[ */
  944.                                 t1 = CopyItem (t, t1, temp_kmode);
  945.                                 ((xptext->link_table)[xptext->link_table_max]).url = link_table_buffer_ptr;
  946.                                 UrlCat (link_table_buffer_ptr, scheme, hostname, path, temp_str, "", "", port);
  947.                                 strcpy (httpfile2->url, link_table_buffer_ptr);
  948.                                 if (WCExist (httpfile2, temp_fname) > WC_NON)
  949.                                     (xptext->link_table)[xptext->link_table_max].in_cache = !0;
  950.                                 else
  951.                                     (xptext->link_table)[xptext->link_table_max].in_cache = 0;
  952.                                 while (*link_table_buffer_ptr++);
  953.                             } else {
  954.                                 t1 = SkipAttr (t1, temp_kmode);
  955.                             }
  956.                             //ffifo[ffifo_ptr++] = 'f';
  957.                             sprintf (tag_href_str, "`L%dU`%-.80s`lu`", xptext->link_table_max, ((xptext->link_table)[xptext->link_table_max]).url);
  958.                             t2 += sprintf (t2, "%s", tag_href_str);
  959.                             //w += strlen (tag_href_str) * 6;
  960.                             break;
  961.                         case ATTR_FRAME_NAME:
  962.                         default:
  963.                             t1 = SkipAttr (t1, temp_kmode);
  964.                             break;
  965.                         }
  966.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  967.                             t1++;
  968.                     }
  969.                     xptext->link_table_max++;
  970.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  971.                     break;
  972.  
  973.                 case TAG_BODY:
  974.                     while (*t1 != '>') {
  975.                         short attr_no;
  976.                         signed short no = -1;
  977.                         t1 = SearchIItem (t1, attr_body_str, &attr_no);
  978.  
  979.                         switch (attr_no) {
  980.                         case ATTR_BODY_TEXT:
  981.                             no = 1;
  982.                             break;
  983.                         case ATTR_BODY_LINK:
  984.                             no = 3;
  985.                             break;
  986.                         case ATTR_BODY_BGCOLOR:
  987.                             no = 0;
  988.                             break;
  989.                         case ATTR_BODY_ALINK:
  990.                         case ATTR_BODY_VLINK:
  991.                         default:
  992.                             break;
  993.                         }
  994.                         if ((no >= 0) && (!pass)) {
  995.                             char temp_str[256];
  996.                             char *t = temp_str;
  997.                             while (*t1++ != '=');
  998.                             t1 = CopyItem (t, t1, temp_kmode);
  999.                             if (temp_str[0] == '#')
  1000.                                 html_color[no] = Str2Color (temp_str);
  1001.                             else
  1002.                                 html_color[no] = 1;    /* debug */
  1003.                         } else {
  1004.                             t1 = SkipAttr (t1, temp_kmode);
  1005.                         }
  1006.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  1007.                             t1++;
  1008.                     }
  1009.                     break;
  1010.  
  1011.                 case TAG_INPUT:
  1012.                     while (*t1 != '>') {
  1013.                         short attr_no;
  1014. #if    0
  1015.                         char temp_str[256], temp_fname[256];
  1016.                         char *t = temp_str;
  1017. #endif
  1018.                         t1 = SearchIItem (t1, attr_input_str, &attr_no);
  1019.  
  1020.                         switch (attr_no) {
  1021.                         case ATTR_INPUT_TYPE:
  1022. #if    0
  1023.                             while (*t1++ != '=');
  1024.  
  1025.                             /* temp_str é╔âRâsü[ */
  1026.                             t1 = CopyItem (t, t1, temp_kmode);
  1027.                             SearchIItem (t, attr_input_type_str, &attr_no);
  1028.                             switch (attr_no) {
  1029.                             case ATTR_INPUT_TYPE_RADIO:
  1030.                                 t2 += sprintf (t2, "`E1`");
  1031.                                 break;
  1032.                             case ATTR_INPUT_TYPE_CHECKBOX:
  1033.                                 t2 += sprintf (t2, "`E0`");
  1034.                                 break;
  1035.                             case ATTR_INPUT_TYPE_RESET:
  1036.                                 t2 += sprintf (t2, "`E0`");
  1037.                                 break;
  1038.                             case ATTR_INPUT_TYPE_SUBMIT:
  1039.                                 t2 += sprintf (t2, "`E0`");
  1040.                                 break;
  1041.                             default:
  1042.                                 t2 += sprintf (t2, "`E0`");
  1043.                                 break;
  1044.                             }
  1045.                             break;
  1046. #endif
  1047.                         default:
  1048.                             t1 = SkipAttr (t1, temp_kmode);
  1049.                             break;
  1050.                         }
  1051.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  1052.                             t1++;
  1053.                     }
  1054.                     break;
  1055.  
  1056.                 case TAG_HR:
  1057.                     ffifo[ffifo_ptr++] = 'h';
  1058.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  1059.                     break;
  1060.  
  1061.                 case TAG_P:
  1062.                     tag_p_align = !0;
  1063.                     if (!tag_center)
  1064.                         align = ALIGN_LEFT;
  1065.                     while (*t1 != '>') {
  1066.                         short attr_no;
  1067.                         char temp_str[256];
  1068.                         char *t = temp_str;
  1069.                         t1 = SearchIItem (t1, attr_p_str, &attr_no);
  1070.  
  1071.                         switch (attr_no) {
  1072.                         case ATTR_P_ALIGN:
  1073.                             while (*t1++ != '=');
  1074.                             t1 = CopyItem (t, t1, temp_kmode);
  1075.                             if (!stricmp (t, "center"))
  1076.                                 align = ALIGN_CENTER;
  1077.                             if (!stricmp (t, "left"))
  1078.                                 align = ALIGN_LEFT;
  1079.                             break;
  1080.                         default:
  1081.                             t1 = SkipAttr (t1, temp_kmode);
  1082.                             break;
  1083.                         }
  1084.                         while (c = *t1, ((c == ' ') || (c == 0x09) || (c == 0x0a) || (c == 0x0d)))
  1085.                             t1++;
  1086.                     }
  1087.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  1088.                     break;
  1089.  
  1090.                 case _TAG_P:
  1091.                     tag_p_align = 0;
  1092.                     nl_flag = !0;    /* îàâïü[âvé≡ö▓é»éΘ */
  1093.                     if (!tag_center)
  1094.                         reset_align = !0;
  1095.                     break;
  1096.  
  1097.                 case TAG_H1:
  1098.                 case TAG_H2:
  1099.                     font_size_stack[font_size_stackptr++] = font_size;
  1100.                     font_size = 8;
  1101.                     t2 += sprintf (t2, "`S%d`", font_size);
  1102.                     nl_flag = !0;
  1103.                     break;
  1104.  
  1105.                 case _TAG_H1:
  1106.                 case _TAG_H2:
  1107.                     if (font_size_stackptr)    /* âlâXâgé¬É│é╡é»éΩé╬ */
  1108.                         font_size = font_size_stack[--font_size_stackptr];
  1109.                     t2 += sprintf (t2, "`S%d`", font_size);
  1110.                     nl_flag = !0;
  1111.                     break;
  1112.  
  1113.                 case TAG_H3:
  1114.                 case TAG_H4:
  1115.                 case TAG_H5:
  1116.                 case TAG_H6:
  1117.                     font_size_stack[font_size_stackptr++] = font_size;
  1118.                     font_size = 6;
  1119.                     t2 += sprintf (t2, "`S%d`", font_size);
  1120.                     nl_flag = !0;
  1121.                     break;
  1122.  
  1123.                 case _TAG_H3:
  1124.                 case _TAG_H4:
  1125.                 case _TAG_H5:
  1126.                 case _TAG_H6:
  1127.                     if (font_size_stackptr)    /* âlâXâgé¬É│é╡é»éΩé╬ */
  1128.                         font_size = font_size_stack[--font_size_stackptr];
  1129.                     t2 += sprintf (t2, "`S%d`", font_size);
  1130.                     nl_flag = !0;
  1131.                     break;
  1132.  
  1133.                 case TAG_TITLE:
  1134.                     tag_title = t1+1;
  1135.                     break;
  1136.  
  1137.                 case _TAG_TITLE:
  1138.                     if ((tag_title != NULL) && ((t1_old - tag_title) < 256)) {
  1139.                         char temp_str[256] = "\"";
  1140.                         /* <title></title> è╘é≡âRâsü[ */
  1141.                         strncpy (temp_str+1, tag_title, (size_t) (t1_old - tag_title));
  1142.                         temp_str[t1_old - tag_title+1] = '"';
  1143.                         CopyItem(xptext->title,temp_str,temp_kmode);
  1144.                         t2 = xptext->text;
  1145.                         t2e = t2 + t2_size - YOYUU;
  1146.                         w = 0;
  1147.                     }
  1148.                     break;
  1149.  
  1150.                 case TAG_HEAD:
  1151.                     tag_head = t1;
  1152.                     break;
  1153.  
  1154.                 case _TAG_HEAD:
  1155.                     /* </head> é≡îƒÅoé╡é╜Ä₧é═â|âCâôâ^é≡âèâZâbâg */
  1156.                     if (tag_head != NULL) {
  1157.                         t2 = t2t = xptext->text;
  1158.                         t2e = t2 + t2_size - YOYUU;
  1159.                         w = 0;
  1160.                         l = xptext->line_ptr;
  1161.                         xptext->line = 0;
  1162.                         xptext->current_line = 0;
  1163.                     }
  1164.                     break;
  1165.  
  1166.                 case TAG_CENTER:
  1167.                     align = ALIGN_CENTER;
  1168.                     tag_center = !0;
  1169.                     break;
  1170.  
  1171.                 case _TAG_CENTER:
  1172.                     tag_center = 0;
  1173.                     reset_align = !0;
  1174.                     nl_flag = !0;
  1175.                     break;
  1176.  
  1177.                 case TAG_SCRIPT:
  1178.                     do {
  1179.                         while ((*t1++ != '/') && (t1 < t1e));
  1180.                         if (!strnicmp (t1, "script", 6)) {
  1181.                             t1 += 6;
  1182.                             nl_flag = !0;
  1183.                             break;
  1184.                         }
  1185.                     } while ((t1 < t1e) && (t2 < t2e));
  1186.                     break;
  1187.  
  1188.                 case TAG_PRE:
  1189.                     tag_pre = !0;
  1190.                     break;
  1191.  
  1192.                 case _TAG_PRE:
  1193.                     tag_pre = 0;
  1194.                     break;
  1195.  
  1196.                 case TAG_OL:
  1197.                     tag_ol = !0;
  1198.                     tag_list_no = 1;
  1199.                     break;
  1200.  
  1201.                 case _TAG_OL:
  1202.                     tag_ol = 0;
  1203.                     break;
  1204.  
  1205.                 case TAG_UL:
  1206.                     tag_ul = !0;
  1207.                     tag_list_no = 1;
  1208.                     break;
  1209.  
  1210.                 case _TAG_UL:
  1211.                     tag_ul = 0;
  1212.                     break;
  1213.  
  1214.                 case TAG_LI:
  1215.                     ffifo[ffifo_ptr++] = 'l';
  1216.                     nl_flag = !0;
  1217.                     break;
  1218.  
  1219.                 case TAG_TABLE:
  1220.                     nl_flag = !0;
  1221.                     break;
  1222.  
  1223.                 case _TAG_TD:
  1224.                     if (w + 6 * 8 > WRAP_DOT) {
  1225.                         not_read_flag = !0;
  1226.                         nl_flag = !0;
  1227.                     } else {
  1228.                         *t2++ = 0x09;    /* tab */
  1229.                         w = (w + 6 * 8) / (short) (6 * 8) * (short) (6 * 8);
  1230.                     }
  1231.                     break;
  1232.  
  1233.                 case _TAG_TR:
  1234.                     nl_flag = !0;
  1235.                     break;
  1236.  
  1237.                 case TAG_DT:
  1238.                     nl_flag = !0;
  1239.                     break;
  1240.  
  1241.                 case TAG_DD:
  1242.                     ffifo[ffifo_ptr++] = 'd';
  1243.                     nl_flag = !0;
  1244.                     break;
  1245.  
  1246.                 case TAG_COMMENT:
  1247.                     break;
  1248.  
  1249.                 default:    /* é╟é╠â^âOé┼éαé╚é⌐é┴é╜ÅΩìçé═ô╟é▌ö≥é╬é╖ */
  1250.                     break;
  1251.                 }
  1252.                 /* ô╟é▄é╚é⌐é┴é╜é▒é╞é╔é╡é╜é⌐üH */
  1253.                 if (not_read_flag) {
  1254.                     t1 = t1_old;
  1255.                 } else {
  1256.                     t1 = SkipLt (t1, temp_kmode);
  1257.                 }
  1258.                 if (nl_flag)
  1259.                     break;
  1260.                 else
  1261.                     continue;
  1262.             }
  1263.             /* ò╢ÄÜâGâôâeâBâeâBé╠Åêù¥ */
  1264.             if (c == '&') {
  1265.                 /* t1 é╠Äwé╖ò╢ÄÜâGâôâeâBâeâBé≡ entity_no é╔ò╘é╖ */
  1266.                 short entity_no = 0;
  1267.                 char **s = entity_str;
  1268.                 int *l = entity_len;
  1269.                 do {
  1270.                     if (!strnicmp (*s, t1, *l)) {
  1271.                         char t = *(t1 + *l);
  1272.                         if ((t == ' ') || (t == 0x09) || (t == ';') || (t == 0x0a) || (t == 0x0d))
  1273.                             break;
  1274.                     }
  1275.                     s++;
  1276.                     l++;
  1277.                     entity_no++;
  1278.                 } while (*s != NULL);
  1279.                 /* âGâôâeâBâeâBé╔éµé┴é─ò¬è≥ */
  1280.                 switch (entity_no) {
  1281.                 case ENTITY_LT:
  1282.                 case ENTITY_GT:
  1283.                 case ENTITY_AMP:
  1284.                 case ENTITY_QUOT:
  1285.                 case ENTITY_NBSP:
  1286.                     t1 += (strlen (entity_str[entity_no]) + 1);
  1287.                     c = entity_char[entity_no];
  1288.                     break;
  1289.                 default:
  1290.                     /* é╟éΩé┼éαé╚é⌐é┴é╜ÅΩìçé╗é╠é▄é▄ò\Ī */
  1291.                     break;
  1292.                 }
  1293.             }
  1294.             if (c == 0x09)
  1295.                 c = ' ';
  1296.             if (c == ' ') {
  1297.                 if (space_flag)    /* Æ╝æOé¬âXâyü[âXé╛é┴é╜é⌐ */
  1298.                     continue;
  1299.                 space_flag = !0;
  1300.             } else {
  1301.                 space_flag = 0;
  1302.             }
  1303.  
  1304.             /* JIS Ä₧é╠è┐ÄÜ IN/OUT âtâëâOé╠Åêù¥ */
  1305.             if (c == 0x1b) {    /* ESC */
  1306.                 /* ò╢ÄÜâRü[âhé¬ö╗éτé╚éóÄ₧é╔ ESC é≡î⌐é┬é»é╜éτ JIS é╞ö╗ÆΦ */
  1307.                 if (temp_kmode == K_AUTO) {
  1308.                     temp_kmode = K_JIS;
  1309.                     McDbPrint ("JIS é╞ö╗ÆΦ\n");
  1310.                 }
  1311.                 if (temp_kmode == K_JIS) {
  1312.                     unsigned char c1 = *(t1 + 1);
  1313.                     switch (*t1) {
  1314.                     case '(':
  1315.                         if ((c1 == 'B') || (c1 == 'J')) {    /* è┐ÄÜ OUT */
  1316.                             aork = 0;
  1317.                             t1 += 2;
  1318.                         }
  1319.                         break;
  1320.                     case '$':
  1321.                         if ((c1 == '@') || (c1 == 'B')) {    /* è┐ÄÜ IN */
  1322.                             aork = !0;
  1323.                             t1 += 2;
  1324.                         }
  1325.                         break;
  1326.                     default:
  1327.                         break;
  1328.                     }
  1329.                     continue;
  1330.                 }
  1331.             }
  1332.             /* ò╢ÄÜâRü[âhé¬é▄é╛ö╗éτé╚éóÄ₧ */
  1333.             if (temp_kmode == K_AUTO) {
  1334.                 /* 0x81~0x9f é≡î⌐é┬é»é╜éτ SJIS é╞ö╗ÆΦ */
  1335.                 if ((c >= 0x81) && (c <= 0x9f)) {
  1336.                     temp_kmode = K_SJIS;
  1337.                     McDbPrint ("SJIS é╞ö╗ÆΦ\n");
  1338.                 }
  1339.                 /* 0xa1~0xcf é≡î⌐é┬é»é╜éτ EUC é╞ö╗ÆΦ */
  1340.                 if ((c >= 0xa1) && (c <= 0xcf)) {
  1341.                     temp_kmode = K_EUC;
  1342.                     McDbPrint ("EUC é╞ö╗ÆΦ\n");
  1343.                 }
  1344.             }
  1345.             if (c == 0x0d) {
  1346.                 aork = 0;
  1347.                 org_line++;
  1348.                 if (*t1 == 0x0a)
  1349.                     t1++;
  1350.                 if (!tag_pre)
  1351.                     continue;    /* Äƒé╠ò╢ÄÜé╓ */
  1352.                 else
  1353.                     break;    /* Äƒé╠ìsé╓ */
  1354.             }
  1355.             if (c == 0x0a) {
  1356.                 aork = 0;
  1357.                 org_line++;
  1358.                 if (!tag_pre)
  1359.                     continue;    /* Äƒé╠ò╢ÄÜé╓ */
  1360.                 else
  1361.                     break;    /* Äƒé╠ìsé╓ */
  1362.             }
  1363.             if (c < ' ') {
  1364.                 //*t2++ = c;
  1365.                 continue;
  1366.             }
  1367.             if (((c == '`') && (temp_kmode <= K_EUC))    /* AUTO or SJIS or EUC */
  1368.                 ||((temp_kmode == K_JIS) && (!aork) && (c == '`'))) {
  1369.                 if (w + font_size > WRAP_DOT) {
  1370.                     t1 = t1_old;    /* ô╟é▄é╚é⌐é┴é╜é▒é╞é╔é╖éΘ */
  1371.                     break;
  1372.                 }
  1373.                 *t2++ = c;
  1374.                 if (font_size * 2 > LINE_Y)
  1375.                     InsertNodeBLB (1, c, 0, font_size, w, 0, 0, 0);
  1376.                 w += font_size;
  1377.                 *t2++ = c;
  1378.                 if (font_size * 2 > LINE_Y)
  1379.                     InsertNodeBLB (1, c, 0, font_size, w, 0, 0, 0);
  1380.                 w += font_size;
  1381.                 continue;
  1382.             }
  1383.             //if ((c >= 0xa0) && (c <= 0xdf))    /* ö╝èpâJâié═û│Äï */
  1384.                 //continue;
  1385.  
  1386.             if (((temp_kmode <= K_EUC) && (c < 0x80))    /* AUTO or SJIS or EUC */
  1387.                 ||((temp_kmode == K_JIS) && (!aork))) {
  1388.                 /* éPâoâCâgò╢ÄÜé╠ÅΩìç */
  1389.                 if (w + font_size > WRAP_DOT) {
  1390.                     t1 = t1_old;    /* ô╟é▄é╚é⌐é┴é╜é▒é╞é╔é╖éΘ */
  1391.                     break;
  1392.                 }
  1393.                 *t2++ = c;
  1394.                 if (font_size * 2 > LINE_Y)
  1395.                     InsertNodeBLB (1, c, 0, font_size, w, 0, 0, 0);
  1396.                 w += font_size;
  1397.                 continue;
  1398.             } else {
  1399.                 /* è┐ÄÜé╠ÅΩìç */
  1400.                 unsigned char c1;
  1401.                 if ((w + font_size * 2) > WRAP_DOT) {
  1402.                     t1 = t1_old;    /* ô╟é▄é╚é⌐é┴é╜é▒é╞é╔é╖éΘ */
  1403.                     break;
  1404.                 }
  1405.                 switch (temp_kmode) {
  1406.                 case K_AUTO:
  1407.                 case K_SJIS:
  1408.                     *t2++ = c;
  1409.                     *t2++ = *t1++;
  1410.                     break;
  1411.                 case K_EUC:
  1412.                     Jis2sjis (((c & 0x7f)), (*t1++ & 0x7f), t2);
  1413.                     break;
  1414.                 case K_JIS:
  1415.                     Jis2sjis (c, *t1++, t2);
  1416.                     break;
  1417.                 }
  1418.                 c1 = *(t2 - 1);
  1419.                 if (font_size * 2 > LINE_Y)
  1420.                     InsertNodeBLB (1, c, c1, font_size, w, 0, 0, 0);
  1421.                 w += font_size * 2;
  1422.                 continue;
  1423.             }
  1424.         } while ((t1 < t1e) && (t2 < t2e));
  1425.         if ((t1 > t1e) || (t2 > t2e))
  1426.             break;
  1427.  
  1428.  
  1429.         if (align == ALIGN_CENTER)
  1430.             l->start_dot = (WRAP_DOT - w) / 2;
  1431.         else
  1432.             l->start_dot = 0;
  1433.         l->org_line = org_line;
  1434.  
  1435.         if (reset_align) {
  1436.             align = ALIGN_LEFT;
  1437.             reset_align = 0;
  1438.         }
  1439.         if (blb_top == NULL) {
  1440.             l->num = t2 - t2t;
  1441.             l++->ptr = t2t;
  1442.             xptext->line++;    /* ìsÉö */
  1443.         } else {    /* æOìsÅêù¥é¬òKùvé╚ÅΩìç */
  1444.             unsigned char temp[1024];
  1445.             int len1;    /* î╗ì▌ìsé╠ò╢ÄÜÉö */
  1446.             int len2;    /* æOìsé╠ò╢ÄÜÉö */
  1447.             unsigned short s = l->start_dot;
  1448.             BLB *t_ptr;
  1449.  
  1450.             len1 = (int) (t2 - t2t);
  1451.             strncpy (temp, t2t, len1);    /* î╗ì▌ìsé≡æ▐ö≡ */
  1452.  
  1453.             t2 = t2t;
  1454.             while ((t_ptr = DeleteNodeBLB ())!= NULL) {
  1455.                 l->ptr = t2;
  1456.                 strcpy (t2, t_ptr->text);
  1457.                 len2 = strlen (t_ptr->text);
  1458.                 l->num = len2;
  1459.                 t2 += len2;
  1460.                 l->start_dot = s;
  1461.                 l->org_line = org_line;
  1462.                 xptext->line++;    /* ìsÉö */
  1463.                 l++;
  1464.                 free (t_ptr);
  1465.             }
  1466.             l->ptr = t2;
  1467.             strcpy (t2, temp);
  1468.             l->num = len1;
  1469.             t2 += len1;
  1470.             l->start_dot = s;
  1471.             l->org_line = org_line;
  1472.             xptext->line++;    /* ìsÉö */
  1473.             l++;
  1474.         }
  1475.     } while ((t1 < t1e) && (t2 < t2e) && (xptext->line < line_table_size));
  1476.     l->ptr = NULL;
  1477.  
  1478.     xptext->kmode = temp_kmode;
  1479.  
  1480.  
  1481.     if (t2 >= t2e)
  1482.         McPrint ("üª âeâLâXâgë≡É═âoâbâtâ@é¬æ½éΦé▄é╣é±\n");
  1483.  
  1484.     if ((xptext->line >= line_table_size))
  1485.         McPrint ("üª ìsô¬âeü[âuâïé¬æ½éΦé▄é╣é±\n");
  1486.  
  1487.  
  1488.     /* ù]ò¬é╔èmò█é╡é╜âüâéâèâuâìâbâNé≡É╪éΦÄ╠é─éΘ */
  1489.     _dos_setblock (xptext->text, (int) t2 - (int) (xptext->text));
  1490.     _dos_setblock (xptext->line_ptr, sizeof (LINE_PTR) * (xptext->line));
  1491.     if (!pass) {        /* Åëë±é╠ë≡É═é╚éτ */
  1492.         if (link_table_buffer_ptr - xptext->link_table_buffer) {
  1493.             _dos_setblock (xptext->link_table_buffer, sizeof (char)
  1494.                    * ((int) (link_table_buffer_ptr - xptext->link_table_buffer)));
  1495.         } else {
  1496.             _dos_mfree (xptext->link_table_buffer);
  1497.             xptext->link_table_buffer = NULL;
  1498.         }
  1499.         if (xptext->link_table_max) {
  1500.             _dos_setblock (xptext->link_table, sizeof (LINK_TABLE) * (xptext->link_table_max));
  1501.         } else {
  1502.             _dos_mfree (xptext->link_table);
  1503.             xptext->link_table = NULL;
  1504.         }
  1505.         if (xptext->image_table_max) {
  1506.             _dos_setblock (xptext->image_table, sizeof (IMAGE_TABLE) * (xptext->image_table_max));
  1507.         } else {
  1508.             _dos_mfree (xptext->image_table);
  1509.             xptext->image_table = NULL;
  1510.         }
  1511.     }
  1512.     return (xptext);
  1513. }
  1514.  
  1515.  
  1516.  
  1517. /* âèâôâNâeü[âuâïé╠ in_cache é≡ìXÉVé╖éΘ */
  1518. void ReCheckLinkTable (XPTEXT * xptext)
  1519. {
  1520.     HTTPFILE *httpfile = alloca (sizeof (HTTPFILE));
  1521.     char temp_fname[256];
  1522.     int i;
  1523.  
  1524.     for (i = 0; i < xptext->link_table_max; i++) {
  1525.         strcpy (httpfile->url, xptext->link_table[i].url);
  1526.         if (WCExist (httpfile, temp_fname) > WC_NON)
  1527.             (xptext->link_table)[i].in_cache = !0;
  1528.         else
  1529.             (xptext->link_table)[i].in_cache = 0;
  1530.     }
  1531. }
  1532.  
  1533.  
  1534.  
  1535. /* âAâôâJü[é≡îƒì⌡é╡é─ìsÉöé≡ò╘é╖ */
  1536. int SearchAnchor (XPTEXT * xptext, char *anchor)
  1537. {
  1538.     int i;
  1539.  
  1540.     for (i = 0; i < xptext->anchor_table_max; i++) {
  1541.         /* anchor+1 é╚é╠é═ '#' é≡ö≥é╬é╖é╜é▀ */
  1542.         if (!stricmp (((xptext->anchor_table)[i]).anchor, anchor + 1))
  1543.             return (((xptext->anchor_table)[i]).line);
  1544.     }
  1545.     return (0);
  1546. }
  1547.  
  1548.  
  1549.  
  1550. void FreeXptext (XPTEXT * xptext)
  1551. {
  1552.     if (xptext != NULL) {
  1553.         if (xptext->text != NULL)
  1554.             _dos_mfree (xptext->text);
  1555.         if (xptext->line_ptr != NULL)
  1556.             _dos_mfree (xptext->line_ptr);
  1557.         if (xptext->anchor_table != NULL)
  1558.             _dos_mfree (xptext->anchor_table);
  1559.  
  1560.         /*
  1561.            link_table, link_table_buffer, image_table é═é▒é▒é┼Ä╠é─é─é═éóé»é╚éóüBù¥ùRé═We
  1562.            bXpression.c é╠ FreeXptext() î─é╤Åoé╡òöé≡î⌐éΘé▒é╞üiòíÉöë±ë≡É═é≡ìséñôxé╔é▒é▒é¬î─é╬
  1563.            éΩéΘé╜é▀üj
  1564.         */
  1565.  
  1566.         _dos_mfree (xptext);
  1567.     }
  1568. }
  1569.  
  1570.  
  1571. void FreeXptext2 (XPTEXT * xptext)
  1572. {
  1573.     short i;
  1574.  
  1575.     if (xptext != NULL) {
  1576.         if (xptext->link_table != NULL)
  1577.             _dos_mfree (xptext->link_table);
  1578.         if (xptext->link_table_buffer != NULL)
  1579.             _dos_mfree (xptext->link_table_buffer);
  1580.         if (xptext->image_table != NULL) {
  1581.             for (i = 0; i < xptext->image_table_max; i++) {
  1582.                 IMAGE_LIST *t_ptr;
  1583.                 t_ptr = (xptext->image_table)[i].image_list;
  1584.                 t_ptr->count--;    /* âèâôâNâJâEâôâgé≡éPé┬ë║é░éΘ */
  1585.             }
  1586.             _dos_mfree (xptext->image_table);
  1587.         }
  1588.     }
  1589. }
  1590.